package com.king01.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author ：lqs
 * @date ：Created in 2023/9/25 15:53
 * @description：
 * @modified By：
 * @version:
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result {
    //状态码 200表示成功 500表示服务器失败
    private Integer code;
    //消息提示内容
    private String msg;
     //表示响应给前端的数据
    private Object data;

    /**
     @create by: George周
     * @description: 查询成功响应(带数据)
     * @create time: 2023/10/10 15:22
      * @param
    * @return */
    public static Result success(Object data){
        return new Result(200,"success",data);
    }
    /**
     @create by: George周
     * @description: 查询成功(不带数据)
     * @create time: 2023/10/10 15:23
      * @param
    * @return */
    public static Result success(){
        return new Result(200,"success",null);
    }
    public static Result error(){
        return new Result(500,"error",null);
    }
}

